oo::class create PopupProjectMenu {
    superclass AppMenu
    variable Menu Label NotebookObj Notebook Pv Pvm 
    
    constructor {menubar} {
        set Menu [menu .popupprojectmenu -tearoff 0]        
	set Pv [lindex [info class instances ::ProjectView] 0]
	set Pvm [lindex [info class instances ::ProjectMenu] 0]
    }

    method setNotebook {nbObj} {
        next $nbObj
	set lbf [set [info object $Pv namespace]::Lbf]
        bind $Pv <Button-3> [subst {
	    if {\[$Pv identify region %X %Y\] != "heading"} {
		set i \[$Pv identify item %X %Y\]
		$Pv selection set \$i
		tk_popup $Menu %X %Y
	    }
	}]
    }

    method createMenu {} {
	foreach row {
	    {command {New {} {} newProj}}
	    {command {Config {} {} configProj}}
	    {command {Remove {} {} removeProj}}
	    {command {Delete {} {} deleteProj}}
	    {command {Close  {} {} closeProj}}
	    {separator {}}
	    {command {Test {} {} testProj}}
	} {
	    my createItem $row
	}
    }

    method newProj {} {	$Pvm createNewProject }
    method configProj {} { $pvm configureProject }
    method removeProj {} { $pvm removeProject}
    method deleteProj {} { $pvm deleteProject}
    method closeProj {} { $pvm closeProject }
    method testProj {} { $pvm testProject }
}